<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <div>水果列表</div>
        <ul>
            <!-- 遍历数组 -->
            <li v-for='item in fruits'>{{item}}</li>
            <!-- 加上索引的方式-->
            <li v-for='(item,index) in fruits'>{{item+'---'+index}}</li>

            <li v-for='item in myfruits'>
                <span>{{item.ename}}</span>
                <span>{{item.cname}}</span>
            </li>
            <!-- :key属性绑定一定伴随着v-for指令一起出现 -->
            <li v-for='item in myfruits' :key = 'item.id' > {{item.cname +'-------------'+item.ename}}</li>
        </ul>
        <!-- 遍历数字 -->
        <ol>
            <li v-for='item in 10'>{{item}}</li>
        </ol>
    </div>
</body>
<script src="./V/vue.js"></script>
<script>
    var vm = new Vue({
        el:'#app',
        data:{
            fruits:['apple','orange','banana'],
            myfruits:[{
                in:0,
                ename:'apple',
                cname:'苹果'
            },{
                id :1,
                ename:'orange',
                cname:'橘子'
            },{
                id:2,
                ename:'banana',
                cname:'香蕉'
            }]
        }
    })
</script>
</html>